import request from '@/utils/request'

//  获取套餐详情
export function getAllGoods(data) {
  return request({
    url: '/api/goodsPackage/list',
    method: 'get',
    params: data
  })
}

//  添加套餐
export function addGoods(data) {
  return request({
    url: '/api/goodsPackage/save',
    method: 'post',
    data: data
  })
}

// 获取所有上架的套餐
export function likeSelectGoods(data) {
  return request({
    url: '/api/goodsPackage/listOnSale',
    method: 'get',
    data: data
  })
}

// 修改套餐的上架和下架状态
export function updateStatusGoods(data) {
  return request({
    url: '/api/goodsPackage/updateStatus',
    method: 'post',
    data: data
  })
}

// 获取详情
export function getById(id) {
  return request({
    url: '/api/goodsPackage/getById/' + id,
    method: 'get'
  })
}
